package com.yfjin.gl.beauty;

import android.content.Context;
import android.opengl.GLES20;

import com.yfjin.gl.R;
import com.yfjin.gl.filter.AbstractFboFilter;

public class BeautyFilter extends AbstractFboFilter {


    private int widthAddress;
    private int heightAddress;

    public BeautyFilter(Context context) {
        super(context, R.raw.base_vert, R.raw.beauty_frag_gaosi);
        widthAddress = GLES20.glGetUniformLocation(program, "vWidth");
        heightAddress = GLES20.glGetUniformLocation(program, "vHeight");
    }

    @Override
    protected void beforeDraw() {
        //1i 表示frag里面的是int 值  ，1f表示里面是float
        GLES20.glUniform1i(widthAddress, mWidth);
        GLES20.glUniform1i(heightAddress, mHeight);
    }

    @Override
    public int onDraw(int texture) {
        super.onDraw(texture);
        return frameTextures[0];
    }
}
